<!-- 样式-->
<style>
    table tr th, table tr td { border:1px solid #ccc; height: 30px;line-height: 30px}
</style>

<pro-header></pro-header>

<!--引入list组件-->
<nz-card [nzBordered]="false">
    <!--  form表单搜索 -->
    <form nz-form (ngSubmit)="getData('search')" [nzLayout]="'inline'">
        <div nz-row [nzGutter]="24">
         
          
                <div  nz-col [nzSpan]="8" class="mb-md">
                    <div nz-form-item class="d-flex">
                        <div nz-form-label><label for="name">分支路径</label></div>
                      <div nz-form-control class="flex-1">
                            <nz-input [(ngModel)]="search.fullPath" name="fullPath"  type='url' aria-required="true" [nzSize]="'large'" [nzPlaceHolder]="'分支路径'" nzId="fullPath"></nz-input>
                        </div>
                    </div>
                </div>
            
                 <div nz-col [nzSpan]="6" class="mb-md">
                    <div nz-form-item class="d-flex">
                        <div nz-form-label><label for="name">分支作用</label></div>
                        <div nz-form-control class="flex-1">
                            <nz-input [(ngModel)]="search.branchFor" name="branchFor"   type='text' aria-required="true" [nzSize]="'large'" [nzPlaceHolder]="'分支作用说明'" nzId="branchFor"></nz-input>
                        </div>
                    </div>
                </div>
                 <div  nz-col [nzSpan]="6" class="mb-md">
                    <div nz-form-item class="d-flex">
                        <div nz-form-label><label>分支类型</label></div>
                        <div nz-form-control class="flex-1">
                            <nz-select style="width: 200px;"
                                       [nzPlaceHolder]="'分支类型'"
                                       [(ngModel)]="search.branchType"
                                       name='search.branchType'>
                                <nz-option
                                    *ngFor="let option of branchType"
                                    [nzLabel]="option.key"
                                    [nzValue]="option.value">
                                </nz-option>
                            </nz-select>
                        </div>
                    </div>
                </div>
              
        
                <div nz-col [nzSpan]="4" class="mb-md" [class.text-right]="expandForm">
                <button nz-button type="submit" [nzType]="'primary'" [nzSize]="'large'">查询</button>
                <button nz-button type="reset" (click)="reset()" [nzSize]="'large'" class="mx-sm">重置</button>
            </div>
        </div>
    </form>
   

    <app-list #child [initDate]="data"     [loading]="listloading"  [showAdd]="showAdd" [isPagination]="isPagination"  [buttons] ='buttons' (addCreat)="addHandler($event)"  (pageNumber)="monitorHandler($event)"
              (deleatData)="deleatData($event)" (buttonEvent)="buttonEvent($event)"  [headerDate]="headerDate"
              [total]="total"  [pageIndex]='pageIndex' [pageTotal] = 'pageTotal'></app-list>
</nz-card>

<nz-modal [nzVisible]="detailsVisible"  [nzWidth]="1024" [nzTitle]="ptitle"  [nzConfirmLoading]="false" [nzContent]="mergeModal"
          (nzOnCancel)="change()" [nzFooter]="is">
    <ng-template #mergeModal>
        <form nz-form (ngSubmit)="addsubmit()" [nzLayout]="'inline'">
            <div nz-row [nzGutter]="24">

                <div  nz-col [nzSpan]="24" class="mb-md">
                    <div nz-form-item class="d-flex">
                        <div nz-form-label nz-col [nzSpan]="4" ><label for="status">分支类型</label></div>
                        <div nz-form-control class="flex-1">
                           <nz-select style="width:100%;" [(ngModel)]="branch.branchType"  [nzMode]="default" name="branch" nzId="branch" [nzPlaceHolder]="'开发分支'" [nzShowSearch]="true" [nzSize]="'large'">
                            <nz-option *ngFor="let i of branchType; let idx = index" [nzLabel]="i.key" [nzValue]="i.value"></nz-option>
                        </nz-select>
                        </div>
                    </div>
                </div>

                <div nz-col [nzSpan]="24" class="mb-md">
                    <div nz-form-item class="d-flex">
                        <div nz-form-label nz-col [nzSpan]="4"><label for="name">分支全路径</label></div>
                        <div nz-form-control class="flex-1">
                              <!--<textarea rows="6"  nz-input [(ngModel)]="branch.branchFor"  nzRequired  nzId="branchFor" [ngModelOptions]="{standalone: true}" ></textarea>-->
                            <nz-input [(ngModel)]="branch.fullPath" name="fullPath" (ngModelChange)="checkagin(branch.fullPath)"  type='url' aria-required="true" [nzSize]="'large'" [nzPlaceHolder]="'分支全路径'" nzId="fullPath"></nz-input>
                         <nz-alert *ngIf='isShowbranch' nzBanner nzMessage="验证异常"></nz-alert>
                        </div>
                          <div nz-form-label nz-col [nzSpan]="2" ><button type="button"  (click)="checkversion(branch.fullPath)" nz-button [nzType]="'default'">
                        <span>{{tag}}</span>
                        </button>
    </div>
                    </div>
                   
                </div>

                <div nz-col [nzSpan]="24" class="mb-md">
                    <div nz-form-item class="d-flex">
                        <div nz-form-label nz-col [nzSpan]="4"><label for="name">分支作用说明</label></div>
                        <div nz-form-control class="flex-1">
                            <textarea rows="6"  nz-input [(ngModel)]="branch.branchFor"  nzRequired   (ngModelChange)="checkString(branch.branchFor)" nzId="branchFor"  [ngModelOptions]="{standalone: true}" ></textarea>
                        <nz-alert  [nzType]="'warning'" nzShowIcon *ngIf='isShowbranchFor == true' nzBanner [nzMessage]="'请勿输入特殊字符！'"></nz-alert>

                        </div>
                    </div>
                </div>

                <div nz-col [nzSpan]="24" class="mb-md">
                    <div nz-form-item class="d-flex">
                        <div nz-form-label nz-col [nzSpan]="4"><label for="name">分支起始版本</label></div>
                
                       <nz-input-number  [(ngModel)]="branch.lastVersion"  name="lastVersion"  [nzSize]="large"  [nzMin]="1" [nzStep]="1" nzId="lastVersion"></nz-input-number>
                    </div>
                </div>

                <div nz-col [nzSpan]="24" [nzOffset]="20" class="mb-md" [class.text-right]="expandForm">
                    <button nz-button type="submit" [nzType]="'primary'" [nzLoading]="loading" [nzSize]="'large'">确定</button>
                    <button nz-button type="reset" (click)="detailsVisible=false" [nzSize]="'large'" class="mx-sm">取消</button>
                </div>
            </div>
        </form>
    </ng-template>
      <ng-template #is>
             </ng-template>
</nz-modal>